from publie.tools import *
from publie.action import *
from publie.testDATE import *

from selenium.webdriver.common.keys import Keys

testCase="DBshop014_删除商品分类"

firefox=openB(adminurl)
adminlogin(firefox)
menuu3(firefox,"商品管理","管理分类","商品分类")
# 1.点击分类名称为“商品分类测试”后方的删除分类"链接
firefox.find_element_by_xpath("//tr/td[contains(.,'%s')]/following-sibling::td[4]/a[3]"%classname).click()
firefox.switch_to.alert.accept()
time.sleep(2)

#断言
try:
    firefox.find_element_by_xpath('//td[contains(.,"%s")]'%(classname))
    writeLog("%s 测试失败"%testCase)
except:
    writeLog("%s 测试通过" % testCase)
    getPhoto(firefox)
firefox.quit()
